package com.sprouting.personal.model.entity;

import com.sprouting.personal.annotations.CheckLength;
import com.sprouting.personal.annotations.CheckNotNull;
import com.sprouting.personal.model.common.BaseModel;
import com.sprouting.personal.model.common.jsr.AddGroup;
import com.sprouting.personal.model.common.jsr.UpdGroup;
import com.sprouting.personal.model.entity.Dict;
import com.sprouting.personal.model.entity.User;
import lombok.Data;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableId;

import javax.validation.constraints.Null;

/**
 * (PsNotepad)表实体类
 * 记事本
 *
 * @author longx
 * @since 2022-12-18 23:09:17
 */
@Data
@TableName("ps_notepad")
public class PsNotepad extends BaseModel {

    /**
     * 主键
     */
    @CheckNotNull(message = "非法ID", groups = UpdGroup.class)
    @Null(message = "无效ID", groups = AddGroup.class)
    @TableId
    private String id;
    /**
     * 隶属用户ID
     * @see User#getId()
     */
    private String userId;
    /**
     * 记事类型
     * @see Dict#getId()
     */
    @CheckNotNull(message = "请选择记事类型")
    private String typeId;
    /**
     * 标题
     */
    @CheckLength(min = 1, max = 300, message = "标题超过长度限制")
    @CheckNotNull(message = "请输入标题")
    private String title;
    /**
     * 内容
     */
    @CheckLength(min = 1, max = 4000, message = "内容超过长度限制")
    @CheckNotNull(message = "请输入内容")
    private String content;
    /**
     * 是否废弃
     * @see com.sprouting.personal.interfaces.common.Constant.YesOrNo#NO 默认使用中
     * @see com.sprouting.personal.interfaces.common.Constant.YesOrNo#YES 已经废弃
     */
    private Integer discard;
    /**
     * 重要程度-标题的颜色
     * @see com.sprouting.personal.interfaces.common.Constant.ImportanceLevel
     */
    private Integer importance;
    /**
     * 标识颜色-自定义的颜色
     */
    private String flagColour;

}

